export default {
  props: {
    options: Object
  },
  watch: {
    options(val) {
      this.initOptions()
    }
  },
  mounted() {
    this.initOptions(this.options)
  },
  methods: {
    initOptions(options) {
      if (options && this.loadData) {
        const { routeCode, stationCode, version } = options
        const params = {
          routerCode: routeCode,
          stationCode,
          version
        }
        this.loadData(params)
      }
    }
  }
}